package demo2;

import java.util.TreeSet;

public class Main2 {
    public static void main1(String[] args) {
        TreeSet treeSet=new TreeSet();
        treeSet.add(1);
        treeSet.add(2);
        treeSet.add(3);
        treeSet.add(3);
        treeSet.add(1);

        System.out.println(treeSet);
    }

    public static void main(String[] args) {
        Student stu1=new Student("zhangsan",12);
        Student stu2=new Student("lise",12);
        Student stu3=new Student("bob",12);
        Student stu4=new Student("tomm",15);
        Student stu5=new Student("李逵",45);

        TreeSet treeSet=new TreeSet();
treeSet.add(stu1);
treeSet.add(stu2);
treeSet.add(stu3);
treeSet.add(stu4);
treeSet.add(stu5);

        System.out.println(treeSet);
    }

}
